package com.kunya.product.controller.portall;

import com.kunya.common.common.ServerResponse;
import com.kunya.product.po.SpecificationAttribute;
import com.kunya.product.service.specofocation.ISpecificationAttributeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WangGang
 * @Description: 规格属性controller
 * @date 2018/7/17 17:16
 */
@RestController
@RequestMapping("/specificationAttribute")
public class SpecificationAttributeController {
    @Autowired
    private ISpecificationAttributeService specificationAttributeService;

    /**
     *添加规格属性
     * @param specificationAttribute
     * @return
     */
    @RequestMapping(value = "/add")
    public ServerResponse addSpecificationAttribute(SpecificationAttribute specificationAttribute){
        return  specificationAttributeService.addSpecificationAttribute(specificationAttribute,"340_");
    }

    /**
     * 修改规格属性
     * @param specificationAttribute
     * @return
     */
    @RequestMapping(value = "/updateSpecificationAttribute")
    public ServerResponse updateSpecificationAttribute(SpecificationAttribute specificationAttribute){
        return specificationAttributeService.updateSpecificationAttribute(specificationAttribute,"340_");
    }

    /**
     * 删除规格属性
     * @param specificationAttribute
     * @return
     */
    @RequestMapping(value = "/deleteSpecificationAttribute")
    public ServerResponse deleteSpecificationAttribute(SpecificationAttribute specificationAttribute){
        return specificationAttributeService.deleteSpecificationAttribute(specificationAttribute,"340_");
    }

    /**
     * 查询分类规格属性列表
     * @param specificationAttribute
     * @return
     */
    @RequestMapping(value = "/selectSpecificationAttribute")
    public ServerResponse selectSpecificationAttribute(SpecificationAttribute specificationAttribute){
        return specificationAttributeService.selectSpecificationAttribute(specificationAttribute,"340_");
    }
}
